# Use at least CMake 3.3
cmake_minimum_required (VERSION 3.3.0)
cmake_policy(VERSION 3.2.2)
cmake_policy(SET CMP0054 NEW)

# Set up the project
project (civetweb)



add_definitions(-g)
add_definitions(-O0)
add_definitions(-DUSE_WEBSOCKET)
add_definitions(-DNO_SSL)
add_definitions(-Wall)
add_definitions(-ldl)

add_executable(client
        client/client.c
        ../src/civetweb.c
        ../src/CivetServer.cpp)

target_include_directories(client
        PUBLIC ../include)

target_link_libraries(client
        PUBLIC pthread)

add_executable(ws_client
        ws_client/ws_client.c
        ../src/civetweb.c
        ../src/CivetServer.cpp)
target_include_directories(ws_client
        PUBLIC ../include
        PUBLIC ../src)


target_link_libraries(ws_client
        PUBLIC pthread)


add_executable(ws_server
        ws_server/ws_server.c
        ../src/civetweb.c
        ../src/CivetServer.cpp)

target_include_directories(ws_server
        PUBLIC ../include
        PUBLIC ../src)


target_link_libraries(ws_server
        PUBLIC pthread)



